﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Medical.Business;
using Medical.Entity;

public partial class Main : AdminPage
{
    /// <summary>
    /// 页面初始化
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            lblName.Text = strAdminName == string.Empty ? strAdminUserName : strAdminName;
            lblDay.Text = DateTime.Now.ToString("yyyy年MM月dd日");

            if (nAdminFeatures != 1)
            {
                if (!SupportFeatures(AdminFEATURE.Sort))
                {
                    Sort.Visible = false;
                    SortTitle.Visible = false;
                }

                bool bTag = false;
                if (!SupportFeatures(AdminFEATURE.Disease))
                {
                    Disease.Visible = false;
                }
                else
                {
                    bTag = true;
                }

                if (!SupportFeatures(AdminFEATURE.Subject))
                {
                    Subject.Visible = false;
                }
                else
                {
                    bTag = true;
                }
                
                if (!SupportFeatures(AdminFEATURE.News))
                {
                    News.Visible = false;
                }
                else
                {
                    bTag = true;
                }

                if (!SupportFeatures(AdminFEATURE.Expert))
                {
                    Expert.Visible = false;
                }
                else
                {
                    bTag = true;
                }

                if (!SupportFeatures(AdminFEATURE.Equipment))
                {
                    Equipment.Visible = false;
                }
                else
                {
                    bTag = true;
                }

                if (!SupportFeatures(AdminFEATURE.Technology))
                {
                    Technology.Visible = false;
                }
                else
                {
                    bTag = true;
                }
                if (!SupportFeatures(AdminFEATURE.Case))
                {
                    Case.Visible = false;
                }
                else
                {
                    bTag = true;
                }

                //if (!SupportFeatures(AdminFEATURE.Guide))
                //{
                //    Guide.Visible = false;
                //}
                //else
                //{
                //    bTag = true;
                //}

                if (!SupportFeatures(AdminFEATURE.Health))
                {
                    Health.Visible = false;
                }
                else
                {
                    bTag = true;
                }
                if (!SupportFeatures(AdminFEATURE.About))
                {
                    About.Visible = false;
                }
                else
                {
                    bTag = true;
                }

                if (!SupportFeatures(AdminFEATURE.FeedBack))
                {
                    FeedBack.Visible = false;
                }
                else
                {
                    bTag = true;
                }

                if (!bTag)
                    Article.Visible = false;

                if (!SupportFeatures(AdminFEATURE.Adver))
                {
                    Adver.Visible = false;
                    AdverTitle.Visible = false;
                }
               
                if (!SupportFeatures(AdminFEATURE.Site))
                {
                    Site.Visible = false;
                    SiteTitle.Visible = false;
                }
                Admin.Visible = false;
                AdminTitle.Visible = false;
            }
            else
            {
                Admin.Visible = true;
                AdminTitle.Visible = true;
            }
        }
    }
}
